package com.sky.service.impl;

import com.sky.entity.Setmeal;
import com.sky.mapper.SetmealUserMapper;
import com.sky.service.SetmealUserService;
import com.sky.vo.DishItemVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;


import java.util.List;

@Service
@Slf4j
@RequiredArgsConstructor
public class SetmealUserServiceImpl implements SetmealUserService {
    private final SetmealUserMapper setmealUserMapper;

    @Override
    @Cacheable(cacheNames = "SETMEAL_BY_CATEGORY_ID",key = "#categoryId")
    public List<Setmeal> selectSetmeal(String categoryId) {
        return setmealUserMapper.selectSetmeal(categoryId);
    }

    @Override
    public List<DishItemVO> selectSetmealDish(String id) {
        return setmealUserMapper.selectSetmealDish(id);
    }
}
